import { memo, useEffect } from "react";
import { useLocation } from "react-router-dom";
import { articleQuery } from "../../network/api";

const Article = () => {
  const location = useLocation(); // 获取state参数

  useEffect(() => {
    {
      console.log(location.state?.name);
      articleQuery(location.state?.name)
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log("err", err);
        });
    }
  }, []);

  return <div>Article</div>;
};

export default memo(Article);
